﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Control="clr-namespace:WPNextTools.NControls">

    <ControlTemplate x:Key="PhoneDisabledPasswordBoxTemplate" TargetType="PasswordBox">
        <Border x:Name="ContentElement"
                Margin="{StaticResource PhonePasswordBoxInnerMargin}"
                BorderThickness="0"
                Padding="{TemplateBinding Padding}" />
    </ControlTemplate>

    <Style TargetType="Control:NWatermarkPasswordBox">
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="Padding" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Control:NWatermarkPasswordBox">
                    <Grid Background="Transparent">
                        <Border x:Name="DisabledOrReadonlyBorder"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{StaticResource PhoneDisabledBrush}">
                            <PasswordBox x:Name="PART_InnerPasswordBox"
                                         FontFamily="{TemplateBinding FontFamily}"
                                         FontSize="{TemplateBinding FontSize}"
                                         FontStyle="{TemplateBinding FontStyle}"
                                         FontWeight="{TemplateBinding FontWeight}"
                                         Foreground="{TemplateBinding Foreground}"
                                         Password="{TemplateBinding RealPassword}"
                                         Template="{StaticResource PhoneDisabledPasswordBoxTemplate}" />
                        </Border>
                        <Border x:Name="EnabledBorder"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}">
                            <Grid>
                                <ContentControl x:Name="watermarkContent"
                                                Margin="12,0"
                                                HorizontalContentAlignment="Left"
                                                VerticalContentAlignment="Stretch"
                                                Background="{TemplateBinding Background}"
                                                Content="{TemplateBinding Watermark}"
                                                Padding="{TemplateBinding Padding}"
                                                Style="{TemplateBinding WatermarkStyle}" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>